<?php

  session_start();

  if(isset($_SESSION["user"]))
  {
    if(isset($_POST["ncs"]))
    {
      $user = $_SESSION["user"];
      session_unset();
      $_SESSION["user"] = $user;
      echo "<SCRIPT language = 'Javascript'>";
      echo "  window.top.main.location='main.php'";
      echo "</SCRIPT>";
    }
    showLinks();
  }
  else
  {
    session_destroy();
    echo "<SCRIPT language='Javascript'>";
    echo "  parent.window.location.href = 'index.php';";
    echo "</SCRIPT>";
  }

  function showLinks()
  {
    include "config.php";
    include "$header";
?>

</HEAD>
<BODY class="back" scroll=no>

<CENTER>

<TABLE width="100%" border="0" cellpadding="1" cellspacing="0" style="margin-top:-10">
  <TR>
    <TD align="center">
      <FORM action="" method="post">
	    <input type="submit" name="ncs" class="new_tabs_off" onMouseOver="className='new_tabs_on'" onMouseOut="className='new_tabs_off'" value="NEW CUSTOMER SESSION" />
      </FORM>
    </TD>
  </TR>

  <TR>
    <TD align="center">
      <FORM action="enquiryAboutProducts.php" target="main" method="post">
	    <input type="submit" name="eap" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="ENQUIRY ABOUT PRODUCTS" />
      </FORM>
    </TD>
  </TR>
 
  <TR>
    <TD align="center">
      <FORM action="recordNewCustomerDetails.php" target="main" method="post">
	    <input type="submit" name="rncd" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="RECORD NEW CUSTOMER DETAILS" />
      </FORM>
	</TD>
  </TR>
  
  <TR>
    <TD align="center">
      <FORM action="changeCustomerDetails.php" target="main" method="post">
        <input type="submit" name="ccd" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="CHANGE CUSTOMER DETAILS" />
      </FORM>
    </TD>
  </TR>

  <TR>
    <TD align="center">
      <FORM action="orderProducts.php" target="main" method="post">
        <input type="submit" name="op" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="ORDER PRODUCTS" />
      </FORM>
    </TD>
  </TR>

  <TR>
    <TD align="center">
      <FORM action="enquiryOnOutstandingOrder.php" target="main" method="post">
        <input type="submit" name="eooo" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="ENQUIRY ON OUTSTANDING ORDER" />
      </FORM>
    </TD>
  </TR>

  <TR>
    <TD align="center">
      <FORM action="cancelOrder.php" target="main" method="post">
        <input type="submit" name="co" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="CANCEL ORDER" />
      </FORM>
    </TD>
  </TR>

  <TR>
    <TD align="center">
      <FORM action="recordCustomerEnquiryProblem.php" target="main" method="post">
        <input type="submit" name="rcep" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="RECORD CUSTOMER ENQUIRY PROBLEM">
      </FORM>
    </TD>
  </TR>

  <TR>
    <TD align="center">
      <FORM name="pcdr" action="prepareCustomerDemandReport.php" target="main" method="post">
        <input type="submit" name="pcdr" class="tabs_off" onMouseOver="className='tabs_on'" onMouseOut="className='tabs_off'" value="PREPARE CUSTOMER DEMAND REPORT" />
      </FORM>
    </TD>
  </TR>

</TABLE>

<?php

  if($_SESSION["userDep"] == "Mail Order")
  {

?>

  <SCRIPT language='Javascript'>
    pcdr.pcdr.disabled = false;
  </SCRIPT>

<?php

  }
  else if($_SESSION["userDep"] == "Telesales")
  {

?>

  <SCRIPT language='Javascript'>
    pcdr.pcdr.disabled = true;
  </SCRIPT>

<?php

  }

?>

</CENTER>

<DIV align="center" style="width:100%; position:absolute; bottom:10px;">

<TABLE width="100%" cellpadding="3" cellspacing="3">
  <TR>
    <TD class="subtabs_off" onMouseOver="className='subtabs_on'" onMouseOut="className='subtabs_off'" style="width:70px">
      <IMG src="images/logout.gif"> &nbsp; 
      <a href="logout.php" target="_parent">
        Log Out
      </a>
    </TD>
    <TD class="subtabs_off" onMouseOver="className='subtabs_on'" onMouseOut="className='subtabs_off'" style="width:100px">
      <IMG src="images/list.gif"> &nbsp; 
      <a href="mailingList.php" target="main">
        Mailing List
      </a>
    </TD>
    <TD class="subtabs_off" onMouseOver="className='subtabs_on'" onMouseOut="className='subtabs_off'" style="width:70px">
	  <IMG src="images/help.gif"> &nbsp; 
      <a href="help.php" target="main">
        Help
      </a>
    </TD>
  </TR>
</TABLE>
</DIV>

</BODY>

<?php
    include "$footer";
  }
  
?>